package br.com.comanda.webservice.business;

import org.junit.Assert;
import org.junit.Test;

import br.com.comanda.webservice.model.Account;
import br.com.comanda.webservice.model.Item;
import br.com.comanda.webservice.model.Product;

public class ItemBusinessTest {

	@Test
	public void testSave() {
		ItemBusiness itemBusiness = new ItemBusiness();

		Product product = new Product();
		product.setId(2);

		Account account = new Account();
		account.setId(1);

		Item item = new Item();
		item.setProduct(product);
		item.setAccount(account);
		item.setQuantity(2);

		itemBusiness.save(item);
	}

	@Test
	public void testGetItem() {
		ItemBusiness itemBusiness = new ItemBusiness();
		Item item = itemBusiness.getItem(5, 1);
		Assert.assertNotNull(item);
	}

}
